package org.bravof.differ.controller;

import org.apache.log4j.Logger;
import org.bravof.differ.entity.SortPO;
import org.bravof.differ.query.PageModel;
import org.bravof.differ.query.Query;
import org.bravof.differ.query.ResultModel;
import org.bravof.differ.service.SortService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 数据库分组Controller
 */
@RestController
@RequestMapping("/sort")
public class SortController {
    private final Logger log = Logger.getLogger(SortController.class);

    @Resource
    private SortService sortService;

    @RequestMapping("/list")
    public PageModel<SortPO> findSortList(Query query, PageModel<SortPO> pageModel) {
        log.info("query = " + query);
        pageModel = sortService.findSortList(query, pageModel);
        return pageModel;
    }

    @RequestMapping("/addOrUpdateSort")
    public ResultModel addOrUpdateSort(SortPO sortPO) {
        return null;
    }
}
